<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>导购目标格式管理</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> 
    <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/zTreeStyle/demo.css" type="text/css">
    <link rel="stylesheet" href="__STATIC__/zTreeStyle/zTreeStyle.css" type="text/css">
   
    <style>
      
    </style>
</head>

<body class="white-bg" style="color:#333;padding:3px;font-size: 12px;">
    <div class="page-heade">
       <h2 class="title_color text-center">导购目标格式管理</h2>
    </div>
        <div class="col-md-12 mtp no-padding">
			<form id="f1" class="form-inline">
			<input type="hidden" name="type_name" value="导购销售目标格式"/>
               <table class="table table-bordered" style="width: 100%;font-size: 13px;">
               		<tr>
						<td style="width: 30%;">是否设置网点维度 <span class="colorRed">*</span>:</td>
						<td style="width: 70%;"><label class="radio-inline"><input type="radio" name="setNet" class="form-control" id="is_true">是</label><label class="radio-inline"><input type="radio" name="setNet" class="form-control" checked id="is_no">否</label></td>
               		</tr>
               		<tr>
						<td style="width: 30%;">是否设置产品维度 <span class="colorRed">*</span>:</td>
						<td style="width: 70%;"><label class="radio-inline"><input type="radio" name="setProduct" class="form-control" id="isSetProduct">是</label><label class="radio-inline"><input type="radio" name="setProduct" checked class="form-control" id="noSetProduct">否</label></td>
               		</tr>
               		<tr id="productTr">
						<td style="width: 30%;">产品维度 <span class="colorRed">*</span>:</td>
						<td style="width: 70%;">
							<select id="product_id" name="product_id" class="form-control select">
								<option value="0">品牌</option>
								<option value="1">品类</option>
								<option value="2">系列</option>
								<option value="3">SKU</option>
								<option value="4">单品</option>
							</select>
						</td>
               		</tr>
               		<tr id="cainianTr">
						<td style="width: 30%;">财年 <span class="colorRed">*</span>:</td>
						<td style="width: 70%;">
							<select id="product_id" name="product_id" class="form-control select">
								<option value="0">2018</option>
							</select>
						</td>
               		</tr>
               		<tr>
						<td style="width: 30%;">考核期维度 <span class="colorRed">*</span>:</td>
						<td style="width: 70%;">
							<select id="kaoheqi_id" name="kaoheqi_id" class="form-control select">
								<option value="0">一级考核期</option>
								<option value="1">二级考核期</option>
							</select>
						</td>
               		</tr>
               </table>
               </form>
               <div class="text-center"><input type="button" value="保存" id="bc" class="btn btn-sm btn-primary"/><br/><br/><br/></div>
            
        </div>

    <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
     <!-- Peity -->
    <script src="__STATIC__/layout/js/plugins/peity/jquery.peity.min.js"></script>

    <!-- jqGrid -->
    <script src="__STATIC__/layout/js/plugins/jqgrid/i18n/grid.locale-cn.js?0820"></script>
    <script src="__STATIC__/layout/js/plugins/jqgrid/jquery.jqGrid.min.js?0820"></script>

    <!-- 自定义js -->
    <script src="__STATIC__/layout/js/content.js?v=1.0.0"></script>
     <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    
    <!-- ztree -->
    <script type="text/javascript" src="__STATIC__/zTreeStyle/jquery.ztree.core.js"></script>
    <script type="text/javascript" src="__STATIC__/zTreeStyle/jquery.ztree.excheck.js"></script>
    <!--统计代码，可删除-->
	<script>
	function ckhide(){
		$("input[name='setProduct']").each(function(){
			if($("#isSetProduct").prop("checked")){
				$("#productTr").show();
				$("#cainianTr").show();
			}else{
				$("#productTr").hide();
				$("#cainianTr").hide();
			}
		})
	}
	$(function(){
		ckhide();
		//保存
		$("#bc").click(function(){
			$.ajax({
                cache: true,
                type: "POST",
                url:"{:url('Xitongexcel/tiyuansuanbc')}",
                data:$('#f1').serialize(),// 你的formid
                async: false,
                error: function(request) {
                    alert("Connection error");
                },
                success: function(data) {
                	//alert(data);
                    if(data==1){
                    	 swal({
                                    title: "完成",
                                    text:  "操作已成功",
                                    type: "success"
                                    },function(){
                                        location.href='{:url("Xitongexcel/tiyuasuan")}';
                                    });
                    }else{
                    	  swal({
                                    title: "错误",
                                    text:  "系统繁忙请稍后再试",
                                    type: "warning"
                                    });
                    }
                }
            });
		})
		
	})
	</script>	
</body>
	
</html>
